(function (lib, config) {
    var loadFunc = function () {
        var textAry = config.words.split('|'), bgcolorAry = config.bgcolor.split('|'), textcolorAry = config.textcolor.split('|'), imglinkAry = config.imglink.split('|'), weblinkAry = config.weblink.split('|'), identiAry = config.identifier.split('|');
        textAry[0] = textAry[0] || '凤凰医院在线咨询中心';
        textAry[1] = textAry[1] || '您好！我是石家庄凤凰医院妇科医师，请问有什么可以帮到您？';
        textAry[2] = textAry[2] || '凤凰医院是意外妊娠定点医院，河北特色医疗重点推广医院！';
        bgcolorAry[0] = bgcolorAry[0] || '#fdfcf9';
        bgcolorAry[1] = bgcolorAry[1] || '#950900';
        bgcolorAry[2] = bgcolorAry[2] || '#b8e2ff';
        bgcolorAry[3] = bgcolorAry[3] || '#950900';
        textcolorAry[0] = textcolorAry[0] || '#ffffff';
        textcolorAry[1] = textcolorAry[1] || '#ffffff';
        textcolorAry[2] = textcolorAry[2] || '#6c6761';
        imglinkAry[0] = imglinkAry[0] || 'http://s3gfk.85613333.com/swt_gb/img/ask_new_sxm.png';
        weblinkAry[0] = weblinkAry[0] || 'tel:18032764591';
        identiAry[0] = identiAry[0] || 'swt_dibu';
        var sHTML = [
        '<div id="toopl" class="shadow"></div>' +
        '<div id="footTool" class="float_container cf">' +
        '<div class="title_swt"><a href="' + weblinkAry[0] + '" style=\'color:'+textcolorAry[0]+';\'>' + textAry[0] + '</a></div>' +
        '<dl id="tools2" class="cf" >' +
        '<dt><img src="' + imglinkAry[0] + '"></dt>' +
        '<dd>' +
        '<div id="now1" class="time1"></div>' +
        '<a href=\"javascript:void(0);\" onclick=\"openZoosUrl(' + identiAry[0] + ');\" style="text-decoration: none;"><div class="box_ss" ><img src="http://s3gfk.85613333.com/swt_gb/img/smile.gif" alt="smile">' + textAry[1] + '</div></a>' +
        '</dd>' +
        '</dl>' +
        '<dl id="tools3" class="cf">' +
        '<dt><img src="' + imglinkAry[0] + '"></dt>' +
        '<dd>' +
        '<div id="now2" class="time1"></div>' +
        '<a href=\"javascript:void(0);\" onclick=\"openZoosUrl(' + identiAry[0] + ');\" style="text-decoration: none;"><div class="box_ss" style="color:'+textcolorAry[2]+';">' + textAry[2] + '</div></a>' +
        '</dd>' +
        '</dl>' +
        '<div class="btn cf">' +
        '<a href="javascript:void(0);" onclick="toolclose();" target=\"_self\" >稍后再说</a>' +
        '<a href=\"javascript:void(0);\" onclick=\"openZoosUrl(' + identiAry[0] + ');\">立即回复</a>' +
        '</div>' +
        '</div>' +
        '<style type=\"text\/css\">' +
        'a{text-decoration:none;}' +
        '.cf:before,.cf:after{display: table;content:\"\"}.cf:after{clear:both}.cf{zoom:1}' +/*left:0; bottom:0 */
        '.shadow {z-index:99999990; display: none; position: fixed; width: 100%; height: 100%; top:0; left:0;background-color: rgba(0,0,0,.2); }' +
        '.float_container {z-index:999991; display: none; position: fixed; width: 100%; '+lib.util.getPosStyle(config)+'; background-color:' + bgcolorAry[0] + '; font-size: 14px;}' +
        '.db { display: block}' +
        '.float_container .title_swt {background:' + bgcolorAry[1] + ';background-size:29px;font-size:16px;line-height:29px;height:29px;color:' + textcolorAry[0] + ';text-align:center;letter-spacing:-1px; font-family:\"Microsoft Yahei\"; }' +
        '.float_container .title_swt a{display: block; color:' +'#fff' + '; text-align:center; position:relative;}' +
        '.float_container .title_swt a:after{content:\"\";display:inline-block;background:url(http://s3gfk.85613333.com/swt_gb/img/ask_new_tel.png) no-repeat;width:19px;height:19px;vertical-align:middle;margin:-3px 5px 0;}' +
        '.float_container dl { display: none; transiton:all .3s linear 0s;margin:0;padding:0;overflow:visible;}' +
        '.float_container dt { display: inline-block; width: 14%; float: left; margin: 34px 0 0 8px; text-align: center}' +
        '.float_container dt img{max-width:100%;border:0;vertical-align:middle;-ms-interpolation-mode: bicubic}' +
        '.float_container dd {margin:0; display: inline-block; position: relative; width: 80%; float: left; margin-top: 15px; }' +
        '.float_container .time1 { font-size: 12px; line-height: 1.6; color:' + '#6c6761' + '; text-align: center;width:100%;margin:0;height:1.6em; }' +
        '.float_container .box_ss {font-size:12px;color:' + textcolorAry[1] + ';position: relative; margin-left: 5%; padding:10px; border:1px solid #b8e2ff; border-radius: 12px; box-shadow: 0 3px 0 #3aa1e5, inset 0 1px 1px #fff; background-color:' + bgcolorAry[2] + ';overflow:visible; }' +
        '.float_container .box_ss span{ color:' + '#de0000' + ';}' +
        '.float_container .box_ss img { width: 22px; vertical-align: bottom; display:inline-block;margin:0 3px 0 0;}' +
        '.float_container .box_ss:before,.float_container .box_ss:after { position: absolute; content: \"\"}' +
        '.float_container .box_ss:before { width: 18px; height: 13px; top:-1px; left:-9px; background:urlhttp://s3gfk.85613333.com/swt_gb/img/arrow.png) 0 0 no-repeat; background-size: 18px; }' +
        '.float_container .box_ss:after { width: 40px; height: 26px; bottom:-4px; right:-7px; background:url(http://s3gfk.85613333.com/swt_gb/img/wave.png) 0 0 no-repeat; background-size: 40px; }' +
        '.float_container .btn { margin-top: 25px; padding:10px 0; background-color: ' + bgcolorAry[3] + '; clear: both;display: table;width: 100%;font-family:\'微软雅黑\'}' +
        '.float_container .btn a { display: inline-block; width: 39%; height: 28px; float:left; margin:0 5%; border-radius: 14px; background-color:' + '#ffffff' + '; font-size: 16px; color:' + '#333333' + '; line-height: 28px; text-align: center; text-decoration: none; transition:all .3s linear 0s;background-image: -moz-linear-gradient(top, #ffffff, #f1f1f1);background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ffffff), color-stop(1, #f1f1f1));box-shadow:0 2px 5px 0 #060001;}' +
        '.float_container .btn a:nth-child(2) {background-image: -moz-linear-gradient(top, #ffe396, #ffba00);background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ffe396), color-stop(1, #ffba00));}' +
        '<\/style>'
        ].join('\r\n');
        var o = document.createElement('div');
        o.innerHTML = sHTML;
        while (o.firstElementChild) {
            document.body.appendChild(o.firstElementChild);
        };
        /*获取当前时间*/
        var now = new Date();
        var hh = now.getHours();
        var mm = now.getMinutes();
        var ss = now.getSeconds();
        var date1 = document.getElementById("now1");
        var date2 = document.getElementById("now2");
        function getDateWeek(obj) { if (obj < 10) return "0" + obj; else return obj; }
        date1.innerHTML = getDateWeek(hh) + ":" + getDateWeek(mm) + ":" + getDateWeek(ss);
        date2.innerHTML = getDateWeek(hh) + ":" + getDateWeek(mm) + ":" + getDateWeek(ss + 5);
        var footTool = document.getElementById("footTool");
        var toopl = document.getElementById("toopl");
        var tools2 = document.getElementById("tools2");
        var tools3 = document.getElementById("tools3");
        setTimeout(toolshow, config.firsttime * 1000);
        function toolshow() {
            footTool.className = "float_container db cf";
            toopl.style.display = "none";
            setTimeout(toolshow2, 0);
        }
        toolshow2 = function () { tools2.style.display = "block"; setTimeout(toolshow3, 2000); }
        toolshow3 = function () { tools3.style.display = "block"; if (config.eachtime > 0) setTimeout(toolclose, config.eachtime * 1000); }
        toolclose = function () {
            footTool.className = "float_container";
            toopl.style.display = "none";
            tools2.style.display = "none";
            tools3.style.display = "none";
            setTimeout(toolshow, config.relapsetime * 1000);
        }

    };
    lib.load(loadFunc);
})('{{lib}}', '{{config}}');